# coding: utf-8


class QiNiuProxy(object):
    """
    add by zhouhl 2018-05-24
    七牛库的实例绑定在app实例上
    不能在models里直接使用 current_app 变量，故封装一层代理
    """

    def init_app(self, app=None):
        self.app = app
        try:
            self.qiniu = app.qiniu
            self.url = app.qiniu.url
        except:
            self.qiniu= None

